package com.lichuang.dedao.user.controller;


import com.lichuang.dedao.user.entity.Collection;
import com.lichuang.dedao.user.service.impl.CollectionServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 收藏 前端控制器
 * </p>
 *
 * @author hanghang
 * @since 2019-07-14
 */
@RestController
@RequestMapping("//collection")
public class CollectionController {

    @Autowired
    private CollectionServiceImpl collectionService;

    @RequestMapping("/selectCollectionsWithRedis")
    public List<Collection> selectCollectionsWithRedis(Integer userId) {
        return collectionService.selectCollectionsWithRedis(userId);
    }

    @RequestMapping("/selectCollectionsByType")
    public List<Collection> selectCollectionsByType(Integer userId, Integer collectionType) {
        return collectionService.selectCollectionsByType(userId, collectionType);
    }

    @RequestMapping("/updateCollectionsWithRedis")
    public List<Collection> updateCollectionsWithRedis(Integer userId, Integer collectionType, Integer objectId) {
        return collectionService.updateCollectionsWithRedis(userId, collectionType, objectId);
    }
}